Skip to content

opt: add PlanGramMismatchPenalty cost penalty flag#169717

Merged
trunk-io[bot] merged 1 commit intocockroachdb:masterfrom
michae2:plangram-mismatch-penalty
May 7, 2026
Merged

opt: add PlanGramMismatchPenalty cost penalty flag#169717
trunk-io[bot] merged 1 commit intocockroachdb:masterfrom
michae2:plangram-mismatch-penalty

Conversation

@michae2
Copy link
Copy Markdown
Collaborator

@michae2 michae2 commented May 5, 2026

Add a new PlanGramMismatchPenalty to the cost penalty bitmask. This penalty will be applied when a plan does not match the required PlanGram pattern. Its precedence is stronger than UnboundedCardinalityPenalty but weaker than FullScanPenalty, so that inline hints (which set FullScanPenalty or HugeCostPenalty) take precedence over PlanGram matching.

Informs: #152053

Release note: None

Co-Authored-By: roachdev-claude [email protected]

@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented May 5, 2026

😎 Merged directly without going through the merge queue, as the queue was empty and the PR was up to date with the target branch - details.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@michae2 michae2 requested review from a team, DrewKimball and ZhouXing19 May 5, 2026 15:52
@michae2 michae2 marked this pull request as ready for review May 5, 2026 15:52
@michae2
Copy link
Copy Markdown
Collaborator Author

michae2 commented May 5, 2026

First commit is #169197 and can be ignored.

@michae2 michae2 force-pushed the plangram-mismatch-penalty branch 2 times, most recently from 1760f15 to 0fbe295 Compare May 6, 2026 16:50
@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented May 6, 2026

Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link)

@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented May 6, 2026

Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link)

1 similar comment
@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented May 6, 2026

Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link)

Copy link
Copy Markdown
Collaborator

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@DrewKimball reviewed 7 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on ZhouXing19).

Add a new PlanGramMismatchPenalty to the cost penalty bitmask. This
penalty will be applied when a plan does not match the required PlanGram
pattern. Its precedence is stronger than UnboundedCardinalityPenalty but
weaker than FullScanPenalty, so that inline hints (which set
FullScanPenalty or HugeCostPenalty) take precedence over PlanGram
matching.

Informs: cockroachdb#152053

Release note: None

Co-Authored-By: roachdev-claude <[email protected]>
@michae2 michae2 force-pushed the plangram-mismatch-penalty branch from f1c1ca4 to 8c540ce Compare May 7, 2026 20:17
@michae2
Copy link
Copy Markdown
Collaborator Author

michae2 commented May 7, 2026

Thanks!

/trunk merge

@trunk-io trunk-io Bot merged commit a1611e0 into cockroachdb:master May 7, 2026
24 checks passed
@michae2 michae2 deleted the plangram-mismatch-penalty branch May 7, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants